<!-- tabbar -->
<template>
  <tabbar style="position: fixed;">
    <tabbar-item selected link="/main/home">
      <img slot="icon" src="../../assets/tabbar1.png" v-if="navBar!='#/main/home'">
      <img slot="icon" src="../../assets/home.png" v-if="navBar=='#/main/home'">
      <span slot="label" :class="{navBarColor:navBar=='#/main/home',c9:navBar!='#/main/home'}">首页</span>
    </tabbar-item>
    <tabbar-item link="/main/fp/otcList">
      <img slot="icon" src="../../assets/tabbar2.png" v-if="!isMainFp">
      <img slot="icon" src="../../assets/tubeMoney.png" v-if="isMainFp">
      <span slot="label" :class="{navBarColor:isMainFp}">理财</span>
    </tabbar-item>
    <tabbar-item  link="/main/quotes">
      <img slot="icon" src="../../assets/tabbar3.png" v-if="navBar!='#/main/quotes'">
      <img slot="icon" src="../../assets/quotation.png" v-if="navBar=='#/main/quotes'">
      <span slot="label" :class="{navBarColor:navBar=='#/main/quotes'}">行情</span>
    </tabbar-item>
    <!-- <tabbar-item  link="/main/wallet">
      <img slot="icon" src="../../assets/walletIcon.png" v-if="navBar!='#/main/wallet'">
      <img slot="icon" src="../../assets/selectedWallet.png" v-if="navBar=='#/main/wallet'">
      <span slot="label" :class="{navBarColor:navBar=='#/main/wallet'}">钱包</span>
    </tabbar-item> -->
    <tabbar-item link="/main/my">
      <img slot="icon" src="../../assets/tabbar4.png" v-if="navBar!='#/main/my'">
      <img slot="icon" src="../../assets/my.png" v-if="navBar=='#/main/my'">
      <span slot="label" :class="{navBarColor:navBar=='#/main/my'}">我的</span>
    </tabbar-item>
  </tabbar>
</template>

<script>
  import { Tabbar, TabbarItem } from 'vux'
  export default {
    props:['isMainFp'],
    components: {
      Tabbar,
      TabbarItem
    },
    data () {
      return {
        navBar:"",
      }
    },
    watch:{
      navBar(v,v1){
        if(v1!=v){
          // alert("发生改变了")
        }
      }
    },
    created(){
      this.getTabar();
    },
    methods:{
      getTabar(){
        this.navBar=location.hash;
      }
    }
  }
</script>

<style lang="less" scoped>
  .navBarColor{
    color:#fecb26
  }
  .c9{
    color:#999;
  }
</style>
